#include <stdio.h>
#include <time.h>

int getHour(time_t now)
{
    struct tm* ltm = localtime(&now);
    return ltm->tm_hour;
}

char* greetAboutTime(time_t now)
{
    int hour = getHour(now);
    char* word;
    if (hour > 6 && hour <= 12)
    {
        word = (char*) "Good morning!";
    } else if (hour > 12 && hour <= 18)
    {
        word = (char*) "Good afternoon!";
    } else
    {
        word = (char*) "Good night!";
    }
    return word;
}